﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Entity;
using System.Data;

namespace Controller
{
    
    public partial class Controller_Account : Component
    {
        Entity_Account _ent_account = new Entity_Account();
        public Controller_Account()
        {
            InitializeComponent();
        }

        public Controller_Account(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }


        public string CheckType_Account(string id, string pass)
        {
            DataSet ds =  _ent_account._CheckType_Account(id, pass);
            
            if (ds != null)
            {
                DataRow dr = ds.Tables[0].Rows[0];
                string s = dr[0].ToString().Trim();
                return s;
            }
            return "Không xác định";
        }
        public DataSet Check_Info_Acc(string id, string pass)
        {
            DataSet ds = new DataSet();
            ds = _ent_account._Check_Info_Acc(id, pass);
            return ds;
        }


        public bool UpdatePass(string ID, string passnew)
        {
            return _ent_account._UpdateAccount(ID, passnew);
        }
        public bool Check_Login(string id, string pass)
        {
            return _ent_account._CheckLogin(id, pass);
        }
    }
}
